package com.mysite.seckill.web.controller;

import com.mysite.seckill.commons.vo.ResultVo;
import com.mysite.seckill.web.service.ProductService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/product")
public class ProductController {

    protected final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private ProductService productService;

    @RequestMapping("/list")
    @ResponseBody
    public ResultVo login() {
        return new ResultVo(productService.getProducts());
    }
}
